package com.dmc.hrl.service.impl;

import com.dmc.hrl.domain.model.HomeContent;
import com.dmc.hrl.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @Author: liang
 * @Date: 2019/12/5 9:09
 */
@Service
public class HomeServiceImpl implements HomeService {

    @Autowired
    private BannerService bannerService;

    @Autowired
    private TopNavService topNavService;

    @Autowired
    private UserService userService;

    @Autowired
    private GoodsService goodsService;

    @Override
    public HomeContent initHome() {
        HomeContent homeContent  = new HomeContent();
        homeContent.setBannerList(bannerService.findAll());
        homeContent.setTopNavList(topNavService.findAll());
        homeContent.setUserList(userService.findAll());
        return homeContent;
    }

    @Override
    public HomeContent getGoods() {
         HomeContent homeContent = new HomeContent();
         homeContent.setGoodsList(goodsService.findAll());
         return homeContent;
    }


}
